package commons.resources;

import java.util.ArrayList;
import java.util.List;

public enum CommonsEnum {
    ID("commons");

    private final String _value;

    CommonsEnum(String string) {
	_value = string;
    }

    /**
     * @return value
     */
    public String getValue() {
	return _value;
    }

    public enum ICONS {

	CHECKED("checked.gif"), UNCHECKED("unchecked.gif"), REQUIRED("required-overlay.gif");

	private final String _value;
	private final static List<String> _values = new ArrayList<String>();
	private final static List<String> _names = new ArrayList<String>();

	ICONS(String string) {
	    _value = string;
	}

	/**
	 * Visual representation of this enum type used for GUI
	 * 
	 * @return
	 */
	public String getValue() {
	    return _value;
	}

	/**
	 * Get list of values
	 * 
	 * @return
	 */
	public static List<String> getEnumValues() {
	    if (_values.size() == 0) {
		for (ICONS e : values()) {
		    _values.add(e.getValue());
		    _names.add(e.name());
		}
	    }
	    return _values;
	}

	/**
	 * Get list of names
	 */
	public static List<String> getEnumNames() {
	    if (_names.size() == 0) {
		for (ICONS e : values()) {
		    _values.add(e.getValue());
		    _names.add(e.name());
		}
	    }
	    return _names;
	}
    }
}